Page({
    data: {
        info: '',
        loading: true,
    },
    onLoad: function(options) {
        this.getDetail(options.refund_id)
    },
    /**获取订单详情 */
    getDetail(refund_id) {
        this.request({
            url: '/supplier/order/refund/detail',
            data: { refund_id }
        }, res => {
            if (res.data.order_status === -1) res.data.order_status = 5
            this.setData({ info: res.data, loading: false })
        })
    },
    /**预览退款图片 */
    priviewRefundImg(e) {
        const { url } = e.currentTarget.dataset
        const urls = this.data.info.photos.map(item => {
            return this.data.imgHost + item.photo
        })
        wx.previewImage({
            current: this.data.imgHost + url,
            urls
        })
    },
})